import http from "@/utils/http";

// 获取预付订单(填写订单)
export const getMemberOrderPre = () => {
    return http({
        url: '/member/order/pre'
    })
}

// 提交订单 /member/order
export const postMemberOrderPre = (data) => {
    return http({
        url: '/member/order',
        method: "post",
        data
    })
}
// 获取订单详情
export const getMembeOrderById = (id) => {
    return http({
        url: `/member/order/${id}`
    })
}

// 模拟支付 /pay/mock

export const getPayMock = (orderId) => {
    return http({
        url: `/pay/mock`,
        data: { orderId }
    })
}

///member/order
/**
 * 获取订单列表
 * @param {Object} data 订单状态，1为待付款、2为待发货、3为待收货、4为待评价、5为已完成、6为已取消，未传该参数或0为全部
 * @returns 
 */
export const getMemberOrder = (data) => {
    return http({
        url: `/member/order`,
        data
    })
}

// 立即购买/member/order/pre/now

export const getMemberOrderPreNow = (data) => {
    return http({
        url: `/member/order/pre/now`,
        data
    })
}